<admintpl file="header" />
</head>
<style>
    .input_edit{
        width:120px;}
</style>
<body>
<div class="wrap js-check-wrap">
    <div class="wrap js-check-wrap">

        <form class="form-horizontal js-ajax-form" action="{:U('NewsSet/defaultIndex')}" method="post">
            <table class="table table-hover table-bordered table-list">
                <if condition="$status eq 1">
                    <thead>
                    <tr>
                        <th width="80">序号</th>
                        <th width="220">业务名称</th>
                        <th width="260">管理员</th>
                    </tr>
                    </thead>
                <!--显示全部栏目列表 可操作-->
                <foreach name="data" item="vo" key="key">
                    <p style="display: none;" id="dis_menu_id">{$vo.menu_id}</p>
                    <tr>
                        <td>
                            {$key+1}
                        </td>
                        <td>
                            {$vo.name}
                        </td>
                        <td>
                            {$vo.usernames}
                            <a style="float:right;"  class="btn btn-primary"  onclick="edit_admin('{$vo.menu_id}','{$vo.admin_ids}','{$vo.usernames}')">修改</a>

                        </td>
                    </tr>
                </foreach>
                <else />
                <!-- 显示有权限的 可操作栏目 -->
                <foreach name="data" item="vo">
                    <?php
                    if($vo['model'] == "Movement"){
                        $the_model = $vo['model'].'/'.lists;
                    }else if($vo['model'] == "Live"){
                        $the_model = $vo['model'].'/'.index;
                    }else if($vo['model'] == "CompanyManagement"){
                        $the_model = 'PeopleManagement/index';
                    }else if($vo['model'] == "Indexadmin"){
                        $the_model = User.'/'.lists;
                    }
                    ?>
                    <tr>
                        <td>
                            <a href="{:U($the_model,array('menu_id'=>$vo['menu_id']))}">{$vo.name}</a>
                        </td>
                    </tr>
                </foreach>

                </if>
            </table>
        </form>
        <div class="pagination">{$page}</div>
    </div>

</div>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
    function edit_admin(menu_id,admin_ids,usernames){
        layer.open({
            type: 2,
            //skin: 'layui-layer-lan',
            title: '修改管理员',
            fix: false,
            shadeClose: true,
            maxmin: true,
            area: ['650px', '500px'],
            content: "<?php echo U('Admin/Other/editAdmin')?>"+'&menu_id='+menu_id+'&admin_ids='+admin_ids+'&usernames='+usernames,
            end: function(){
                location.reload();
            }
        });
    }

</script>

</body>
</html>